package train48days;

import java.util.Scanner;

public class 求最大连续的bit数 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
            String str = Integer.toBinaryString(sc.nextInt());
            String str1[] = str.split("0");
            int max = 0;
            for (int i = 0; i < str1.length; i++) {
                if (str1[i].length()>max){
                    max =str1[i].length();
                }
            }
            System.out.println(max);
        }
    }
